from rediscluster import StrictRedisCluster
from flask import  Flask,flash
from flask import render_template
from flask_bootstrap import Bootstrap
app = Flask(__name__)
bootstrap = Bootstrap(app)
startup_nodes = [{"host": "127.0.0.1", "port": "7001"}]
rc = StrictRedisCluster(startup_nodes=startup_nodes, decode_responses=True)
app.config['SECRET_KEY'] = 'a62f2225bf70bfaccbc7f1ef2a397836717377da'
@app.route('/')
def index():
    rid = rc.randomkey()
    flash('原文ID: '+rid+',点击进入')
    return render_template('index.html',rid = rid)
if __name__ == '__main__':
    app.run(host='0.0.0.0',port=3000)
